﻿namespace Pyramid.Text
{
    using Pyramid.Utility;

    public abstract class Encoding
    {
        public int GetByteCount(string data)
        {
            Validate.IsNotNull(data, "data");

            var characters = data.ToCharArray();

            return this.GetByteCount(characters, 0, characters.Length);
        }

        public int GetByteCount(char[] data)
        {
            Validate.IsNotNull(data, "data");

            return this.GetByteCount(data, 0, data.Length);
        }

        public abstract int GetByteCount(char[] data, int offset, int count);
    }
}
